const projectName = import.meta.env.VITE_GLOB_APP_TITLE;

export function warn(message: string) {
  console.warn(`[${projectName} warn]:${message}`);
}

export function error(message: string) {
  throw new Error(`[${projectName} error]:${message}`);
}

export function catchError(callBack: Fn) {
  try {
    callBack && callBack();
  } catch (error: any) {
    console.log(
      '%cerror===>15： ',
      'background: rgb(23, 197, 237,.6); color: #ff5023; font-size:18px;font-weight:700',
      error,
    );
    throw error;
  }
}
